//
//  XiaoKaiAttackTableViewCell.m
//  Project_A
//
//  Created by 凯 on 15/7/14.
//  Copyright (c) 2015年 zhoukaidong. All rights reserved.
//

#import "TypeCollectionViewCell.h"
#import "UIImageView+WebCache.h"
#import "BaseHeader.h"

@implementation TypeCollectionViewCell
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.mainimageView = [[[UIImageView alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH / 5, SCREEN_WIDTH / 5)]autorelease];
        self.mainimageView.image = [UIImage imageNamed:@"10207895.jpg"]; 
        [self addSubview:self.mainimageView];
       // self.mainimageView.backgroundColor = RGBACOLOR(230, 230, 230, 1);
        
        self.nameLabel = [[[UILabel alloc]initWithFrame:CGRectMake(0, SCREEN_WIDTH / 5  + SCREEN_HEIGHT / 120, SCREEN_WIDTH/5, SCREEN_HEIGHT / 30)]autorelease];
      self.nameLabel.backgroundColor = RGBACOLOR(230, 230, 230, 1);
        self.nameLabel.textAlignment = NSTextAlignmentCenter;
        self.nameLabel.font = [UIFont systemFontOfSize:15];
        self.nameLabel.textColor = NAVCOLOR;
        [self addSubview:self.nameLabel];
        
    }
    return self;
}

-(void)drawWithSecation:(NSInteger)section model:(TypeModel *)model
{
    
    [self.mainimageView setImageWithURL:[NSURL URLWithString:model.icon] placeholderImage:nil];
    self.nameLabel.text = model.aname;
    
}
@end
